package com.calm.editor.entity;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import com.google.gson.annotations.Expose;

@Entity
@Table(name = "XHTML_PROJECT")
public class Project {
	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.TABLE,generator="PROJECT_ID")
	@TableGenerator(name = "PROJECT_ID", table = "ID_SEQUENCE", pkColumnName = "ID_KEY", valueColumnName = "VALUE", pkColumnValue = "PROJECT_ID", allocationSize = 1)
	private Integer id;
	@Column(name = "NAME")
	private String name;
	@OneToMany
	@JoinColumn(name = "PROJECT_ID")
	@Expose(serialize = false)
	private List<Page> pages;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<Page> getPages() {
		return pages;
	}

	public void setPages(List<Page> pages) {
		this.pages = pages;
	}

}
